package com.woniuxy.main.handler;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.woniuxy.main.pojo.Student;
import com.woniuxy.main.pojo.Vi_user_student;
import com.woniuxy.main.service.StudentService;

import lombok.Data;

@Controller
@RequestMapping("/student")
@Scope("prototype")
@Data
public class StudentHandler {
	
	@Resource
	private StudentService studentService;
	
	@RequestMapping("/findAllStudent")
	@ResponseBody
	public List<Vi_user_student> findAllStudent(){
		List<Vi_user_student> students=studentService.findAllStudent();
		return students;
	}
	
	//查询学员交易完成次数
	@RequestMapping("/findOrderCount")
	@ResponseBody
	public int findOrderCount(int sid){
		int result=studentService.findOrderCount(sid);
		return result;
	}
	
	//查询学员好评次数
	@RequestMapping("/findPositiveCount")
	@ResponseBody
	public int findPositiveCount(int sid){
		int result=studentService.findPositiveCount(sid);
		return result;
	}
	
}
